import { defineStore } from 'pinia'

export const useCounterStore = defineStore('counter', {
  state: () => ({
    count: 0,
    data: null
  }),
  actions: {
    async fetchData() {
      const res = await fetch('/api/data')
      this.data = await res.json()
    },
    increment() {
      this.count++
    }
  }
})